let noTokenWhitList = ['/auth/login'];
import store from '@/store';
/**
 * 请求拦截
 * @param {Object} http
 */
module.exports = (vm) => {
	uni.$tn.http.interceptors.request.use((config) => { // 可使用async await 做异步操作
			// 初始化请求拦截器时，会执行此方法，此时data为undefined，赋予默认{}
			config.data = config.data || {}

			config.header = {
				...config.header,
				// Authorization: vm.vuex_token
			}
			if (vm.vuex_token != null) {
				config.header["Authorization"] = "" + vm.vuex_token
			}
			if (noTokenWhitList.indexOf(config.url) >= 0) {
				delete config.header.token;
				delete config.header.Authorization;
			}
			return config
		}, (config) => // 可使用async await 做异步操作
		Promise.reject(config))
}